<?php
require_once 'Service/GallerieManager.php';
require_once 'Service/MitgliederManager.php';


/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Zeigt den View für das Zuteilen der Fotos an die Mitlglieder an
 *
 * @author Andy Nick
 */
class GallerieMitgliederView {
    
    
    public function ShowContent(){
        if($_REQUEST["work"]){
            print_r($_POST);
        }
        else{
        $galManager = new GallerieManager();
            $mitgManager = new MitgliederManager();
            $id =  $galManager->GetNextUnallocatePicID();
            echo "<form action='index.php' method='post'>";
            echo "<div id='member_anzeige2colleft'>
                <img src ='",$galManager->GetImagePathByID($id),"' width='450'/>
                <input type='submit' value='senden'>
                <input name='contentKey' type='hidden' value='gallerieMitg' />
                <input name='work' type='hidden' value='upload' />
              </div>";   
            $mitgArray = $mitgManager->GetAllActive();
            echo '<div id="member_anzeige2colright">';
            $this->showMitgChkbx($mitgArray);
            echo "</div></form>";
        }
           
    }
    
    private function showMitgChkbx($array){
        for($i = 0; $i< count($array); $i++){
            echo "<input type='checkbox' name='mitg' value='",$array[$i]["MITG_KEY"],"'/>",$array[$i]["MITG_NAM"]," ",$array[$i]["MITG_VNAM"],"<br/>";
        }
    }
    
}

?>
